#include <iostream>
using namespace std;

template<typename T>
ostream& print(ostream &os, const T &t)
{
	return os << t;
}

template<typename T, typename... Args>
ostream& print(ostream &os, const T &t, const Args&... rest)		// չ Args
{
	os << t << ", ";
	return print(os, rest...);					// չ rest
}

template<typename T>
int test(const T &t)
{
	static int i = 0;
	return i++;
}

template<typename...Args>
ostream& msg(ostream &os, const Args... rest)
{
	return print(os, test(rest)...);			// չ
}
int main()
{
	msg(cout, 1, 2, "hello");	// 1, 0, 0

	return 0;
}